import React from 'react';
import styles from './TeacherAttendance.css';
import TeacherSelectList from './TeacherSelectList'
import TeacherAttendanceCanlender from './TeacherAttendanceCanlender'
import {Row,Col} from 'antd'
function TeacherAttendace({teachers,
    teacherLoading,
    attendance,
    onTeacherSelect}) {
    let CanlenderProps={
        target:attendance.selected,
        data:attendance.selected?attendance.attendanceMap[attendance.selected.id]:null,
        loading:attendance.loading
    }
  return (
    <Row className={styles.normal} gutter={40}>
        <Col span={21}>
            <TeacherAttendanceCanlender
                {...CanlenderProps}
             />
        </Col>
        <Col span={3}>
            <TeacherSelectList
                loading={teacherLoading}
                teachers={teachers}
                selected={attendance.selected}
                onSelect={(v)=>{
                    onTeacherSelect(v)
                }}
            />
        </Col>
    </Row>
  );
}

export default TeacherAttendace;
